﻿#include <iostream>
#include"filter.h"
#include "geometric.h"
#include "morph.h"
#include "fenge.h"
#include "mymap.h"
#include "histogram.h"
#include "muban.h"
#include "vidioo.h"
#include "mouse.h"
#include "face.h"
void callBack(int, void*);
int main()
{
	
	//Mat src=imread("red.jpg");
	  Mat src = imread("lenna.jpg");
	//Mat src = imread("circle.jpg");
	 //Mat src = imread("poker.jpg");
	//Mat src = imread("contours.jpg");

	//vector<Vec3b> colors;
	//for (size_t i = 0; i < 10; i++)
	//{  //生成随机颜色
	//	int r = theRNG().uniform(0, 255);
	//	int g = theRNG().uniform(0, 255);
	//	int b = theRNG().uniform(0, 255);
	//	colors.push_back(Vec3b((uchar)b, (uchar)g, (uchar)r));

	//	cout << colors[i];
	//}
	
	/*namedWindow("in");
	imshow("in", src);*/

	//myShowContours(src);
	//distWater(src);
	//Mat dest;

	//dest=(backHist(src)).clone();
	//cout << dest;
	//namedWindow("out");
	//imshow("out", dest);

	/*double* result = new double[3];
	compHist(src, dest, result);
	cout << "correl: " << result[0]<<" kafang: "<< result[1] << "  bashi:" << result[2];*/
	  //imshow("in", src);
	//myMouse(src);

	   src = imread("fubaoyin.jpg");
	  face_dect(src);
	 // fastFaceDect();
	 waitKey();




	//createTrackbar("aaa", "out",&init, 21, callBack,&src);
}
void callBack(int init, void* usrdata) {
	int s = init * 2 + 1;
	Mat src = *(Mat*)(usrdata);
	Mat dest;
	Mat mat = getStructuringElement(MORPH_CROSS,Size(s,s));
	//dilate(src,dest,mat);
	erode(src, dest, mat);
	imshow("out",dest);

}

